#pragma once
#include "core/NamedObject.h"
#include "core/Processor.h"
#include "core/AppRoot.h"

//////////////////////////////////////////////////////////////////////////
//interface
class ISubsystem: public NamedObject
{
public:
	inline virtual ~ISubsystem(void) {};

	//alloca risorse
	virtual void init(const PlatformData& data)=0;

	//libera le risorse
	virtual void shutdown()=0;

	//info di sistema
	virtual const String& getInfo()=0;
};

///////////////////////////////////////////////////////////////////////////

class BaseSubsystem: public ISubsystem, boost::noncopyable 
{

protected:	
	AppRoot * const approot;
	mutable String _name;
	String _info;

protected:	
	inline BaseSubsystem(AppRoot *const approot) 
		: approot(approot)
	{	
		
	}	

	inline virtual ~BaseSubsystem(void)
	{			
	}
	

public:	

	inline AppRoot& getAppRoot() const
	{
		return (*approot);
	} 

	virtual inline void init(const PlatformData& data)
	{		

	}

	virtual inline void shutdown()
	{
		
	}

	virtual inline const String& getInfo()
	{
		return _info;
	}


	

protected:
	

};

